package cn.stylefeng.guns.modular.lx.mapper;

import cn.stylefeng.guns.modular.lx.entity.LxGoodsLike;
import cn.stylefeng.guns.modular.lx.model.params.LxGoodsLikeParam;
import cn.stylefeng.guns.modular.lx.model.result.LxGoodsLikeResult;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 商品表----like Mapper 接口
 * </p>
 *
 * @author like
 * @since 2023-12-20
 */
public interface LxGoodsLikeMapper extends BaseMapper<LxGoodsLike> {

    /**
     * 获取列表
     *
     * @author like
     * @Date 2023-12-20
     */
    List<LxGoodsLikeResult> customList(@Param("paramCondition") LxGoodsLikeParam paramCondition);

    /**
     * 获取map列表
     *
     * @author like
     * @Date 2023-12-20
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") LxGoodsLikeParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author like
     * @Date 2023-12-20
     */
    Page<LxGoodsLikeResult> customPageList(@Param("page") Page page, @Param("paramCondition") LxGoodsLikeParam paramCondition, @Param("condition") String condition);

    /**
     * 获取分页map列表
     *
     * @author like
     * @Date 2023-12-20
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") LxGoodsLikeParam paramCondition);

    @Update("update lx_goods_like set goods_inventory = goods_inventory - 1 where id = #{id}")
    ResponseData upInve(int id);
}
